import React, { Component } from 'react'
// import qs from 'qs'
const data = [
  {id: '01', content: '你好，01'},
  {id: '02', content: '你好，02'},
  {id: '03', content: '你好，03'},
  {id: '04', content: '你好，04'},
]
export default class Home_Message_Detail extends Component {
  
  render() {
    // 接收params参数
    const { id, title } = this.props.match.params

    // 接收search参数
    // const { id, title } = qs.parse(this.props.location.search.slice(1))

    // 接收state参数
    // const { id, title } = this.props.location.state

    const detailObj = data.find((obj) => { 
      return obj.id === id
    })
    
    return (
      <div>
        <div>Home_Message_Detail</div>
        <ul>
          <li>ID：{ id }</li>
          <li>Title：{ title }</li>
          <li>ID：{ detailObj.content }</li>
        </ul>
      </div>
    )
  }
}
